package com.lebang.medicalInquiry.utils.shengwang;



public class RtcTokenBuilder2Sample {
    static String appId = "bee84c8d5eb54fbab87f7a9641940672";
    static String appCertificate = "4cba386ff966478ea044f1a72f937061";
    static String channelName = "doctor";
    static String account = "2082341273";
    static int uid = 2;
    static int tokenExpirationInSeconds = 3600;
    static int privilegeExpirationInSeconds = 3000;
    static int joinChannelPrivilegeExpireInSeconds = 3600;
    static int pubAudioPrivilegeExpireInSeconds = 3600;
    static int pubVideoPrivilegeExpireInSeconds = 3600;
    static int pubDataStreamPrivilegeExpireInSeconds = 3600;

    public static void main(String[] args) {
        RtcTokenBuilder2 token = new RtcTokenBuilder2();
        String result = token.buildTokenWithUid(appId, appCertificate, channelName, uid, RtcTokenBuilder2.Role.ROLE_PUBLISHER,
                tokenExpirationInSeconds, privilegeExpirationInSeconds);
        System.out.println("Token with uid: " + result);

//        result = token.buildTokenWithUserAccount(appId, appCertificate, channelName, account, RtcTokenBuilder2.Role.ROLE_SUBSCRIBER,
//                tokenExpirationInSeconds, privilegeExpirationInSeconds);
//        System.out.println("Token with account: " + result);
//
//        result = token.buildTokenWithUid(appId, appCertificate, channelName, uid, tokenExpirationInSeconds,
//                joinChannelPrivilegeExpireInSeconds, pubAudioPrivilegeExpireInSeconds, pubVideoPrivilegeExpireInSeconds,
//                pubDataStreamPrivilegeExpireInSeconds);
//        System.out.println("Token with uid and privilege: " + result);
//
//        result = token.buildTokenWithUserAccount(appId, appCertificate, channelName, account, tokenExpirationInSeconds,
//                joinChannelPrivilegeExpireInSeconds, pubAudioPrivilegeExpireInSeconds,
//                pubVideoPrivilegeExpireInSeconds, pubDataStreamPrivilegeExpireInSeconds);
        System.out.println("Token with account and privilege: " + result);
    }
}
